using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Tilemaps;

public class PassDetector : MonoBehaviour
{
    public static PassDetector Instance;

    //public TileBase tile;
    public Tilemap tilemap;
   
    private int _blockGridX;
    private int _blockGridY;
    // Start is called before the first frame update
    void Start()
    {
        Instance = this;
        //tilemap.SetTile(new Vector3Int(16, 4, 0), tile);
    }

    // Update is called once per frame
    void Update()
    {
        
    }

    public void SetCanPass(int gridX, int gridY)
    {
        _blockGridX = gridX;
        _blockGridY = gridY;

        XRes.LoadAsset<TileBase>("Tile_GateOpen", (tile) => {
            tilemap.SetTile(new Vector3Int(_blockGridX, _blockGridY, MapMix.DefaultZInt), tile);
        });
    }
}
